#pragma once

#include <string>
#include "D3DGraphics.h"
#include "physics.h"

class unit_t
{
public:
	unit_t() {};
	unit_t::unit_t( const state_t &state, float radius, const color_t &color )
					: state(state), color(color), body(radius) {};

	// Use a "State" variable containing velocity and position. Can then more easily handle acceleration etc.
	// Use a "Shape" object, only describing the shape. The position will be the center of the shape.

	float mass;
	state_t state;
	circle_t body;
	color_t color;

	/* What forces are exerted on the unit by the world? Friction, gravity, etc. */
	/* Forces from collisions with other units should be separate */
	void receive_force( const vector_2D_t &force );

	bool in_collision( const unit_t &other_unit );

	void move( double delta_time ); // Have the ability to reverse the move, so that we can revert to smaller steps, thereby resolving collisions
	void draw( D3DGraphics &gfx, const rectangle_screen_t &view_rect );

	// virtual elapse_time(float delta_time)
};

class main_unit_t : public unit_t
{
public:
	main_unit_t() : unit_t() {}
	main_unit_t( const state_t &state, int radius, const color_t &color ) 
					: unit_t(state, radius, color) {}
	// process_commands()
};

class ai_unit_t : public unit_t
{
public:
	ai_unit_t() : unit_t() {}
	ai_unit_t( const state_t &state, int radius, const color_t &color ) 
				: unit_t(state, radius, color)  {}
	// run_ai()
};